.class public abstract Lcom/burstly/lib/util/SafeRunnable;
.super Ljava/lang/Object;
.source "SafeRunnable.java"

# interfaces
.implements Ljava/lang/Runnable;


# static fields
.field private static final LOG:Lcom/burstly/lib/util/LoggerExt;

.field private static final TAG:Ljava/lang/String;


# instance fields
.field private final mLifecycleAware:Ljava/lang/ref/Reference;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/lang/ref/Reference",
            "<",
            "Lcom/burstly/lib/component/networkcomponent/burstly/html/IDestroyableActivityLifecycleAware;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 19
    invoke-static {}, Lcom/burstly/lib/util/LoggerExt;->getInstance()Lcom/burstly/lib/util/LoggerExt;

    move-result-object v0

    sput-object v0, Lcom/burstly/lib/util/SafeRunnable;->LOG:Lcom/burstly/lib/util/LoggerExt;

    .line 24
    const-class v0, Lcom/burstly/lib/util/SafeRunnable;

    invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcom/burstly/lib/util/SafeRunnable;->TAG:Ljava/lang/String;

    return-void
.end method

.method public constructor <init>(Lcom/burstly/lib/component/networkcomponent/burstly/html/IDestroyableActivityLifecycleAware;)V
    .locals 1
    .parameter "lifecycleAware"

    .prologue
    .line 36
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 37
    new-instance v0, Ljava/lang/ref/WeakReference;

    invoke-direct {v0, p1}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V

    iput-object v0, p0, Lcom/burstly/lib/util/SafeRunnable;->mLifecycleAware:Ljava/lang/ref/Reference;

    .line 38
    return-void
.end method


# virtual methods
.method public abstract doRun()V
.end method

.method public final run()V
    .locals 4

    .prologue
    .line 43
    :try_start_0
    iget-object v2, p0, Lcom/burstly/lib/util/SafeRunnable;->mLifecycleAware:Ljava/lang/ref/Reference;

    invoke-virtual {v2}, Ljava/lang/ref/Reference;->get()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/burstly/lib/component/networkcomponent/burstly/html/IDestroyableActivityLifecycleAware;

    .line 44
    .local v1, target:Lcom/burstly/lib/component/networkcomponent/burstly/html/IDestroyableActivityLifecycleAware;
    if-eqz v1, :cond_0

    invoke-interface {v1}, Lcom/burstly/lib/component/networkcomponent/burstly/html/IDestroyableActivityLifecycleAware;->wasDestroyed()Z

    move-result v2

    if-nez v2, :cond_0

    .line 45
    invoke-virtual {p0}, Lcom/burstly/lib/util/SafeRunnable;->doRun()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 51
    .end local v1           #target:Lcom/burstly/lib/component/networkcomponent/burstly/html/IDestroyableActivityLifecycleAware;
    :cond_0
    :goto_0
    return-void

    .line 48
    :catch_0
    move-exception v0

    .line 49
    .local v0, exception:Ljava/lang/Exception;
    sget-object v2, Lcom/burstly/lib/util/SafeRunnable;->LOG:Lcom/burstly/lib/util/LoggerExt;

    sget-object v3, Lcom/burstly/lib/util/SafeRunnable;->TAG:Ljava/lang/String;

    invoke-virtual {v2, v3, v0}, Lcom/burstly/lib/util/LoggerExt;->logThrowable(Ljava/lang/String;Ljava/lang/Throwable;)V

    goto :goto_0
.end method
